Files

The goal of this part is to get the files, familiarize yourself with them, and run the tests.

1 Clone the repo

We will use GitHub classroom to get access to the files. Here is how it will work:

  1. I will send a link to the assignment on GitHub classroom.
  2. Click the link to get started on the assignment.
  3. Commit your work back to GitHub.

More detailed information is available here.

Important

You will need to accept the invitation to our GitHub organization, to be able to get access to the assignments.

Tour of the files

The repo contains many files. Most of them are configuration files for the project. Here are the most important files you will need to use / understand for this assignment:

src/Regex.hs
A data structure for representing regular expressions. You will not need to modify this file, but you will need to understand it.
src/Evaluation.hs
Implements regular-expression derivatives and regular-expression matching. You will modify this file to implement the main algorithms for derivatives.
src/Compilation.hs
Implements an algorithm that generates a diagram of a DFA that corresponds to a provided regular expression. You will modify it to generate all the states of the DFA.
src/Optimization.hs
In this file, you will implement some optimizations that minimize and canonicalize regular expressions.
app/Main.hs
Creates a diagram of a specific regular expression. The main purpose of this file is to be an entry point for the debugger, if you need it.
test/
Contains tests and some example instances of Regex.

2 Run the tests

Try running the tests by opening a terminal and running the command:

stack test

All the tests should fail because we have not yet implemented all the parts of the assignment.